{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">搜索管理</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
    </div>
</div>
<script type="text/html" id="barTool">
    <a href='{:url("del")}?ids={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del">删除</a>
</script>
{/block}
{block name="script"}
<script>
    layui.use(['yznTable', 'upload'], function() {
        var table = layui.yznTable,
            $ = layui.$,
            upload = layui.upload;

        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            delete_url: "{:url('del')}",
        };

        table.render({
            init: init,
            toolbar: ['refresh','delete'],
            url: '{:url("index")}',
            search:true,
            cols: [
                [
                    { type: 'checkbox', fixed: 'left' },
                    { field: 'id', width: 70, title: 'ID' },
                    { field: 'keywords', width: 150, title: '关键字' },
                    { field: 'site_id', width: 150, title: '站点ID', align:'center'},
                    { field: 'nums',width: 150, title: '搜索次数', align:'center', sort:'true'},
                    { field: 'ip', title: 'ip' },
                    { field: 'update_time', width: 160, align:'center', title: '更新时间', search: 'range', sort:'true' },
                    { fixed: 'right', align:'center', width: 130, title: '操作', toolbar: '#barTool' }
                ]
            ],
            page: {}
        });
    });
</script>
{/block}